class DlgPrompt extends Dlg
var body;
var label;
var input;
var yesButton;
var noButton;
var doBack;
function DlgPrompt(text,doBack){
	this.doBack=doBack;
	this.addChild([
		[{dim:"body",pos:["c",200,550,250],bg:["#fff","#888",6],mask:true},
			[new Label(text),{dim:"label",pos:[30,40,490],align:"c"}],
			[Input,{dim:"input",doEnter:[this,this.onInputEnter],pos:[40,90,"f-80",45],bg:[,"#ccc",6]}],
			[new Button(["取消","#000"]),{dim:"noButton",pos:[0,"b","f/2",75],bg:["#fff",["#eee"]]}],
			[new Button(["确定","#0b0"]),{dim:"yesButton",pos:["r","b","f/2",75],bg:["#fff",["#eee",,"#eee"]]}],
		]
	]);
	this.input.focus();
}
function onInputEnter(){
	if(!this.input.text) return;
	this.close();
	call(this.doBack,this.input.text);
}
function onButtonClick(){
	switch(G.target){
		case this.yesButton:this.onInputEnter();break;
		case this.noButton:this.close();break;
	}
}